package net.disy.cadenza.repository.selector;

import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;

public class ResultObjectTypes {
	private Map<String, List<String>> objectAttributeToValues = new HashMap<String, List<String>>();
	private Map<String, Set<String>> keywordToObjectAttributes = new HashMap<String, Set<String>>();
	
	public ResultObjectTypes(Map<String, List<String>> objectAttributeToValues, Map<String, Set<String>> keywordToObjectAttributes){
		this.objectAttributeToValues = objectAttributeToValues;
		this.keywordToObjectAttributes = keywordToObjectAttributes;
	}

	public Map<String, List<String>> getObjectAttributeToValues() {
		return objectAttributeToValues;
	}

	public Map<String, Set<String>> getKeywordToObjectAttributes() {
		return keywordToObjectAttributes;
	}
	
	public boolean hasAttributeWithValue(String attributeName, String attributeValue){
		List<String> values = objectAttributeToValues.get(attributeName);
		if(values == null)
			return false;
		return values.contains(attributeValue);
	}
	
	public String toString(){
		return objectAttributeToValues.toString();
	}
	
}
